oxenstored: when reading / read automatically the root node.
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Fri, 10 Sep 2010 18:01:31 +0000 (19:01 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Fri, 10 Sep 2010 18:01:31 +0000 (19:01 +0100)
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/ocaml/xenstored/store.ml

index 34552bb9d3d7a029297a416a4158c2423fd3c856..4c9b1663e6b9464e320cc19fe76bb5d8562818e6 100644 (file)
@@ -300,7 +300,12 @@ let read store perm path =
                Node.check_perm ent perm Perms.READ;
                ent.Node.value
        in
-       Path.apply store.root path do_read
+       if path = [] then (
+               let ent = store.root in
+               Node.check_perm ent perm Perms.READ;
+               ent.Node.value
+       ) else
+               Path.apply store.root path do_read
 
 let ls store perm path =
        let children =